<?php
include('header.php');
include('inc/addondb.php');

if(isset($_POST['send'])) {
$rec2 = mysql_query("SELECT * FROM `users` WHERE `email`='{$_POST['email']}'");
$rec = mysql_fetch_object($rec2);
if($_POST['email'] == ""){
$mesaj = "<div class=\"error\">ERROR: Please enter your email address!</div>";
}else if($rec->login == ""){
$mesaj = "<div class=\"error\">ERROR: Email address is not registered in our database.!</div>";
}else{
$subject ="Site Activation";
$message="Hello $rec->login,

Welcome!

Thank you for joining YouPlusLike, the free Social Media Exchange. 

Now all that's left is cimply clicking the link below to activate your account: 
{$site['site_url']}/activate.php?cod=$rec->activate
	
Best Regards!";
$header="From: Site Admin <{$site['site_email']}>";
$to = $_POST['email'];
$send_contact=mail($to,$subject,$message,$header);
$mesaj = "<div class=\"success\">Success! Validation email has been resent!</div>";
  }}?>
<div class="block medium right">
			<div class="top">
                  <h1>Resend email validation code</h1>
            </div>
			<div class="content"><div class="msg"><?echo $mesaj;?></div>
			<form id="form" method="post">
				<fieldset>
					<p>
						<label>Email</label>
 						<input class="text big" name="email" type="email" value="" required="required" />
					</p>
					<p>
					<input class="button gray small" type="submit" name="send" value="Send" />
					</p>
				</fieldset>
			</form>
		</div>
	</div>
<?include('footer.php');?>